package com.wzy.business.room.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.wangzhenyu.common.base.bean.LoginInfo

@Dao
interface LoginInfoDao {
    @Insert
    fun addLoginInfo(vararg loginInfo: LoginInfo): List<Long>

    //更新，若出现冲突，则使用替换策略，还有其他策略可选
    @Update(onConflict = OnConflictStrategy.REPLACE)
    fun updateLoginInfo(vararg loginInfo: LoginInfo): Int

    @Delete
    fun deleteLoginInfo(vararg loginInfo: LoginInfo): Int

    @Query("SELECT * FROM login_info where mobile = :phone ")
    fun queryLoginInfoByPhone(phone: String): List<LoginInfo>


}